package com.book.bookmanager;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@SpringBootApplication(scanBasePackages = "com.book.bookmanager")
public class BookmanagerApplication implements WebMvcConfigurer {

    public static void main(String[] args) {
        SpringApplication.run(BookmanagerApplication.class, args);
    }


    //implements WebMvcConfigurer
    @Override//图片上传
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //imctemp-rainy只是想要映射路径而已，换成a,b,c都可以
        registry.addResourceHandler("/imctemp-rainy/**").addResourceLocations("file:C:\\Users\\lsx\\IdeaProjects\\bookmanager\\src\\main\\webapp\\uploaded");
    }
}